<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        var div = document.createElement('div');
        var p = document.createElement('p');
        div.setAttribute('class','example');
        p.setAttribute('class','slogan');
        var text = document.createTextNode('最帅');
        p.appendChild(text);
        div.appendChild(p);
        document.body.appendChild(div);

    </script>
</body>
</html>